Merged
Conversation
Adding an experimental module that examines the end of speech utterances and classifies them as either good (natural ending), cutoff (abrupt ending), silence (long tail of silence), or noise (tail with high energy). Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
This gets rid of the torchaudio dependency. Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
2dab2ed to
32265a5
Compare
…magpietts_eou_quality
blisc
requested changes
Mar 9, 2026
nemo/collections/tts/modules/magpietts_inference/evaluate_generated_audio.py
Outdated
Show resolved
Hide resolved
* Reorganize data classes * Rename some classes for clarity * Get rid of global constant only used once * Slightly increase one of the thresholds Signed-off-by: Fejgin, Roy <rfejgin@nvidia.com>
…magpietts_eou_quality
blisc
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a metric that measures end-of-utterance performance.
Each utterance is classified as one of:
New metrics reported by the evaluation script are
eou_cutoff_rate,eou_silence_rate,eou_noise_rateandeou_error_rate, whereeou_error_rateaccumulates all non-good cases (cutoff OR silence OR noise).End-of-Utterance (EoU) Classifier Algorithm
This classifier detects whether a speech sample ends naturally or has an artifact (cutoff, trailing silence, or trailing noise). It works in two stages:
1. CTC Forced Alignment
We run the generated audio through a pretrained Wav2Vec2 CTC model (
facebook/wav2vec2-base-960h) and use NeMo Forced Aligner'sviterbi_decodingto force-align the audio frames to the target transcript. This produces per-character token segments with timestamps and confidence scores. The end of the last aligned token gives us and estimate of the speech boundary — the point where intelligible speech ends and any trailing audio begins.2. Trailing-Region Analysis & Classification
Using the speech boundary, we split the audio into a speech region and a trailing region (with a small padding of the speech region of 100-150ms to account for Wav2Vec2's end-of-segment inaccuracy). We then extract features from both regions:
These features feed a simple decision tree:
3. Additional Notes
Accuracy
This metric is still somewhat experimental and we don't have enough labeled data to measure its accuracy. But it was tested on both ground truth test sets and noisy generated speech sets and worked quite well. It was found to be,
Limitations
Support English only, for now. The metric is set to
nanfor other languages.Speed
It's pretty fast – the metric processed 2300 utterances in about 36 seconds on my machine. The speed is aided by batching.
Testing
Included is a unit test that verifies some utterances whose ending types is known are classified correctly.